<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>编辑</title>
<meta name="viewport" content="width=100%, initial-scale=1.0, user-scalable=no" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="/lib/weix/style/weui.min.css">
<link rel="stylesheet" href="/css/fonts.css">
<link rel="stylesheet" href="/css/comm.css">
</head>

<body>
<div class="weui-cells__title">类型选择</div>

<div class="weui-cells weui-cells_radio">
    <!--<label class="weui-cell weui-check__label">
        <div class="weui-cell__bd">
            <p>管理员</p>
        </div>
        <div class="weui-cell__ft">
            <input type="radio" class="weui-check J_ans" name="radio" checked data-lx="管理员">
            <span class="weui-icon-checked"></span>
        </div>
    </label>-->
	
    <div class="weui-loadmore" id="J_loadmore" style="display:none;">
        <i class="weui-loading"></i>
        <span class="weui-loadmore__tips">正在加载</span>
    </div>
    
    <a href="javascript:void(0);" class="weui-cell weui-cell_link" id="J_caoz">
        <div class="weui-cell__bd">添加更多</div>
    </a>
</div>

<script src="/js/zepto.min.js"></script>
<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
<script src="/js/comm.js"></script>
<script type="text/javascript">
//类型列表
function leix_List(){
	var uid = "${uid}";
	var data = {rows:100,uid:uid,id:'${id}'};   //id 2,员工  3,合伙人
	
	//var data = {uid:uid,id:id,rows:1000};   //id 2,员工  3,合伙人
	
	var url = "/role/getRole";
	
	$('#J_loadmore').show();
	
	$.ajax({
		type: "POST",
		dataType: 'json',
		async: false,
		contentType: "application/json; charset=utf-8",
		data: JSON.stringify(data),
		url: url,
		success: function(res){
			if(res.code == 200){
				var list = res.data.list;
				for (var i =0;i<list.length;i++){
					
					//var shtml = '<a class="weui-cell weui-cell_access J_data" href="javascript:;" data-id="'+list[i]['id']+'" data-name="'+list[i]['name']+'">'+
//									'<div class="weui-cell__hd ren"><i class="icon-label"></i></div>'+
//									'<div class="weui-cell__bd">'+
//										'<p class="cell_tit">'+list[i]['name']+'</p>'
//					if(list[i]['id'] == 0){
//					shtml +=			'<p class="weui-media-box__desc">系统默认类型，拥有所有操作权限</p>'
//					}
//					shtml +=		'</div>'
//					
//					if(list[i]['id'] != 0){
//					shtml +=		'<div class="weui-cell__ft"></div>'
//					}
//					shtml +=	'</a>'
					
					var shtml = '<label class="weui-cell weui-check__label">'+
									'<div class="weui-cell__bd">'+
										'<p>'+list[i]['name']+'</p>'+
									'</div>'+
									'<div class="weui-cell__ft">'+
										'<input type="radio" class="weui-check J_ans" name="radio" checked data-id="'+list[i]['id']+'" data-name="'+list[i]['name']+'">'+
										'<span class="weui-icon-checked"></span>'+
									'</div>'+
								'</label>'
					
					
					
					$('#J_loadmore').before(shtml)
				}

			}else{
				weui.topTips(res.msg);
			}
		},
		error: function(e){

		},
		complete: function(e){
			$('#J_loadmore').hide();
		}
	});

}



function leix000000000000(){
	var id  = "${id}";
	var data = {id:id};
	var url = "/user/getUserDeail";
	$.ajax({
		type: "POST",
		async: false,
		dataType: 'json',
		contentType: "application/json; charset=utf-8",
		data: JSON.stringify(data),
		url: url,
		success: function(res){
			//console.log(res);
			if(res.code == 200){
				
				var list = res.data.list;
				for (var i =0;i<list.length;i++){
					//var shtml = '<a class="weui-cell weui-cell_access J_data" href="javascript:;" data-id="'+list[i]['id']+'" data-name="'+list[i]['name']+'">'
					
					var shtml = '<label class="weui-cell weui-check__label">'+
									'<div class="weui-cell__bd">'+
										'<p>管理员</p>'+
									'</div>'+
									'<div class="weui-cell__ft">'+
										'<input type="radio" class="weui-check J_ans" name="radio" checked data-lx="管理员">'+
										'<span class="weui-icon-checked"></span>'+
									'</div>'+
								'</label>'
	
					$('#J_caoz').append(shtml)
				}
				
				
			}else{
				weui.topTips(res.msg);
			}
		},
		error: function(){
		},
		complete: function(){
		}
	});
}


$(function(){
	//-------------------------------------------------------------------
	//类型数据
	leix_List()


});
</script>
</body>
</html>
